# This code replicates Table 2
rm(list=ls())
setwd("")
library(foreign)
data <- read.dta("data.dta")

column1 <- rbind(100*table(data$exp1_leave)[2]/(table(data$exp1_leave)[1] + table(data$exp1_leave)[2]), 100*table(data$exp1_leave)[1]/(table(data$exp1_leave)[1] + table(data$exp1_leave)[2]))
column2 <- rbind(100-100*table(data$accepts_wrongdoings_leader)[1]/(table(data$accepts_wrongdoings_leader)[1]+table(data$accepts_wrongdoings_leader)[2]), 100-100*table(data$accepts_wrongdoings_leader)[2]/(table(data$accepts_wrongdoings_leader)[1]+table(data$accepts_wrongdoings_leader)[2]))

table <- round(cbind(column1, column2),1)
colnames(table) <- c("Obeyed order from authority?", "Accepts wrongdoing by authority?")
rownames(table) <- c("Yes", "No")
table
